package com.cloudlead.fleetAction.action;

import com.cloudlead.common.lang.BusinessModule;
import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.lang.persistence.Page;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.fleetAction.BusinessModules;
import com.cloudlead.fleetAction.service.PlacePriceEditSer;
import com.cloudlead.fleetService.vo.PlacePriceCreateVo;
import com.cloudlead.fleetService.vo.PlacePriceVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by wyj on 2015/8/17.
 */
@Controller
public class PlacePriceEditActionFactory extends AbstractActionFactory implements PlacePriceEditSer {
    public PlacePriceEditActionFactory() {super(BusinessModules.PlacePriceEdit); }//模块加载

    @Autowired
    PlacePriceEditSer placePriceEditSer;

    @Action
    @Order(1)
    @Label("车队报价创建")
    public String createPlacePrice(@NotNull PlacePriceCreateVo cvo) {
        return placePriceEditSer.createPlacePrice(cvo);
    }

    @Action
    @Order(2)
    @Label("车队报价分页查询")
    public Page<PlacePriceVo> findAllPlacePrice( @Label("基本条件")PlacePriceVo vo, @Label("每页数量")int size, @Label("页码")int page) {
        return placePriceEditSer.findAllPlacePrice(vo,size,page);
    }

    @Action
    @Order(3)
    @Label("车队报价删除")
    public String delPlacePrice(@NotNull @Label("车队报价ID")String id) {
        return placePriceEditSer.delPlacePrice(id);
    }
}
